import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np

sns.set_style({'font.sans-serif':['SimHei', 'Arial']})
plt.rcParams['font.sans-serif'] = 'SimHei'  # 设置中文显示
x = np.arange(1, 10, 2)
y1 = x + 1
y2 = x + 3
y3 = x + 5
def showLine(flip=1):
    sns.lineplot(x=x, y=y1)
    sns.lineplot(x=x, y=y2)
    sns.lineplot(x=x, y=y3)

with sns.axes_style('white'):
    showLine()
    sns.despine()  # 默认无参数状态，就是删除上方和右方的边框
    plt.title('控制图形边框')
plt.show()


with sns.axes_style('white'):
    data = np.random.normal(size=(20, 6)) + np.arange(6) / 2
    sns.boxplot(data=data)
    sns.despine(offset=10, left=False, bottom=False)
    plt.title('控制图形边框')
plt.show()
